package com.xy.modulemain

import android.Manifest
import android.app.Activity
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.Toast
import com.alibaba.android.arouter.facade.annotation.Autowired
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.blankj.utilcode.util.PermissionUtils
import com.blankj.utilcode.util.ToastUtils
import com.xy.modulemain.api.ApiService
import com.xy.modulemain.api.MainNetWorkApi
import com.xy.modulemain.bean.User
import com.xy.network.bean.ResponseBean
import com.xy.network.observer.BaseObserver
import retrofit2.*

@Route(path = "/modulemain/MainModuleActivity")
class MainModuleActivity : AppCompatActivity() {
    @Autowired(name = "route", desc = "默认值")
    lateinit var str: String

    @Autowired(desc = "默认值")
    lateinit var route: String


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main_module)
        ARouter.getInstance().inject(this) //添加后才能接收界面传递的参数

        if (::str.isInitialized && ::route.isInitialized) {
            Toast.makeText(this, "$str?----$route?", Toast.LENGTH_SHORT).show()
        }
        val beginTransaction = supportFragmentManager.beginTransaction()
        beginTransaction.add(R.id.moduleMainFragment,MainModuleFragment())
        beginTransaction.commitAllowingStateLoss()
    }
}